package org.ziegler.algorithm.dijkstra;

import org.apache.commons.lang3.builder.ToStringBuilder;

public class Edge {
    private String from;
    private String to;

    private int cost;
    private Edge parent;

    public Edge(String from, String to, int cost) {
        this.from = from;
        this.to = to;
        this.cost = cost;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public int getCost() {
        return cost;
    }

    public void setCost(int cost) {
        this.cost = cost;
    }

    public Edge getParent() {
        return parent;
    }

    public void setParent(Edge parent) {
        this.parent = parent;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("from", from)
                .append("to", to)
                .append("value", cost)
                .append("parent", parent)
                .toString();
    }
}
